<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<title>考勤</title>
		<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css" />
		<link rel="stylesheet" type="text/css" href="../static/css/me.css" th:href="@{/css/me.css}"/>
	</head>
	<body>
		<!-- 头部 -->
		<nav class="ui padded-t-small">
			<div class="ui container">
				<div class="ui secondary menu">
					<h2 class="ui blue header item">信息技术系</h2>
					<div class="right menu m-item m-mobile-hide">
						<div class="ui dropdown item">
							<div class="text">
								<i class="user blue big icon"></i>
								<span th:text="${session.student.name}">王锦超</span>
							</div>
							<i class="dropdown icon"></i>
							<div class="menu">
								<a href="#" th:href="@{/logout}" class="item">退出</a>
							</div>
						</div>
					</div>

				</div>
				<div class="ui secondary pointing three item demo menu">
					<a href="index.html" th:href="@{/notice}" class="item">公告栏</a>
					<a href="record.html" th:href="@{/record}" class="active item">考勤栏</a>
					<a href="information.html" th:href="@{/information}" class="item">个人信息</a>
				</div>
			</div>
		</nav>
		<!-- 主体 -->
		<div class="ui container margin-t-small">
			<div class="ui top attached segment">
				<div class="ui secondary menu">
					<form name="search"  method="post">
						<div class="ui icon input">
							<input type="text" id="query" placeholder="Search...." th:value="${session.student.name}">
							<i id="btn-se" class="circular search link icon"></i>
						</div>
					</form>
					<div class="right menu">
						<a th:href="@{/cx/{name}(name=${session.student.name})}" class="ui blue button">
							撤销申请
						</a>
					</div>
				</div>
			</div>
			<div class="ui bottom attached segment">
				<table th:fragment="record-fra" class="ui table res">
				  <thead>
				    <tr>
				      <th>日期</th>
				      <th>姓名</th>
				      <th>学号</th>
				      <th>班级</th>
					  <th>状态</th>
				    </tr>
				  </thead>
				  <tbody>
				    <tr th:each="re:${r}">
				      <td th:text="${re.recordTime}">2020-03-03</td>
				      <td th:text="${re.name}">王锦超</td>
				      <td th:text="${re.sno}">170319170222</td>
				      <td th:text="${re.grades}">计算1702</td>
					  <td th:text="${re.state}">迟到</td>
				    </tr>
				  </tbody>
				</table>
			</div>
		</div>



		<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
		<script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
		<script>
			$('.ui.dropdown').dropdown();
			$("#btn-se").click(function () {
				//alert($('#query').val());
				$.ajax({
					type: "POST",   //提交的方法
					url:"/search/re", //提交的地址
					data:{query:$('#query').val()},// 序列化表单值
					error: function(request) {  //失败的话
						alert("搜索出错，请联系管理员");
					},
					success: function(data) {  //成功
						//alert(data);  //就将返回的数据显示出来
						$(".ui.res").html(data);
					}
				});
			});
		</script>
	</body>
</html>
